package com.mav.service.iml;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.mav.mapper.LogMapper;
import com.mav.pojo.OperateLog;
import com.mav.pojo.PageResult;
import com.mav.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LogServiceIml implements LogService {
    @Autowired
    LogMapper logMapper;
    @Override
    public PageResult<OperateLog> list(Integer page, Integer pageSize) {
        PageHelper.startPage(page,pageSize);
        List<OperateLog> list=logMapper.list();

        Page<OperateLog> page1=(Page<OperateLog>) list;
        return new PageResult<>(page1.getTotal(),page1.getResult());

    }
}
